<?php

class ZFWork_Grid extends Bvb_Grid_Deploy_Table {

	public static $_loadDefaultTemplate = true;

	/**
	 * Retorna o objeto Grid Table
	 *
	 * @param string $gridName Nome da grid
	 * @param Zend_Config|array $options Opções da grid
	 * @param string $id Id da Grid
	 * @return ZFWork_Grid_Deploy_Table
	 */
	public static function myFactory($gridName, $options=array(), $id='') {
		$grid = Bvb_Grid::factory('ZFWork_Grid_Deploy_Table', $options, $id);
		$grid->setNameGrid($gridName);

		if (self::$_loadDefaultTemplate) {
			$grid->addTemplateDir(PATH_ZFEXTEND . '/ZFWork/Grid/Template', 'ZFWork_Grid_Template', 'table');
			$grid->setTemplate('Table', 'table');
		}

		$grid->addFormatterDir(PATH_ZFEXTEND . '/ZFWork/Grid/Formatter', 'ZFWork_Grid_Formatter');

		$grid
				->setAlwaysShowOrderArrows(false)
				->setNoFilters(true)
				->setExport(array())
				->setRecordsPerPage(15)
				->setImagesUrl('/temas/famfamfam/')
		;

		return $grid;
	}

}